package com.shop.cloud.service.hongfu.impl;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shop.cloud.common.mybatis.BaseService;
import com.shop.cloud.common.mybatis.MybatisDao;
import com.shop.cloud.dao.hongfu.BannerDao;
import com.shop.cloud.domain.hongfu.Banner;
import com.shop.cloud.service.hongfu.IBannerService;

/**
 * 
 */
@Service("bannerService")
public class BannerService extends BaseService<Banner> implements
		IBannerService {

	@Autowired
	private BannerDao bannerDao;

	@Override
	public MybatisDao<Banner> getEntityDao() {
		return bannerDao;
	}

	@Override
	public int delete(String bannerID) {
		// TODO Auto-generated method stub
		int resultInt = 0;

		if (StringUtils.isNotEmpty(bannerID)) {
			Banner banner = this.get(new Long(bannerID));
			banner.setStatus(1);

			resultInt = this.update(banner);
		}

		return resultInt;
	}

}